package com.springcloud.providers.controller;

import com.springcloud.api.common.CommonResult;
import com.springcloud.api.entities.ArticleEntity;
import com.springcloud.providers.servcie.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/article/")
public class ArticleController {
    @Autowired
    private ArticleService articleService;

    @ResponseBody
    @GetMapping("list")
    public CommonResult<List<ArticleEntity>> findAll(){
        return CommonResult.success(articleService.findAll());
    }
}
